package com.share.design.memo.demo01;

/**
 * @author caifan
 * @since 2022/11/8
 */
public class Client {
    public static void main(String[] args) {
        Blog blog = new Blog(1L, "My Blog");
        blog.setContent("ABC");      //原始的文章内容
        System.out.println(blog);
        BlogMemento memento = blog.createMemento();   //创建blog的备忘录
        blog.setContent("123");      //改变内容
        System.out.println(blog);
        blog.restore(memento);       //撤销操作
        System.out.println(blog);
    }
}
